package com.koron.css2.clientCenter.impl;

import com.koron.css2.ServerInterface;
import com.koron.css2.clientCenter.bean.OpenUserDetailQueryBean;
import com.koron.css2.clientCenter.mapper.OpenUserMapper;
import com.koron.css2.serviceManage.bean.RequestBean;
import com.koron.css2.serviceManage.bean.UserInfoBean;
import com.koron.css2.serviceManage.utils.JsonUtils;
import com.koron.util.Constant;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

public class OpenUserDetailDelete implements ServerInterface {

	@Override
	public MessageBean<?> exec(SessionFactory factory, UserInfoBean userInfo, RequestBean req) {
		// TODO Auto-generated method stub
		OpenUserDetailQueryBean bean = JsonUtils.objectToPojo(req.getData(), OpenUserDetailQueryBean.class);
		OpenUserMapper mapper = factory.getMapper(OpenUserMapper.class);
		mapper.deleteDetailById(bean.getId());
		return  MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "删除成功", String.class);
	}

}
